<#import "../tpl/pageTep.ftl" as page>
<@page.pageBase currentMenu="订单管理">
<style>
    .control-group p {
        margin: 0 0 0 20px;
        float: left;
        font-size: 10px;
        text-align: left;
        line-height: 30px;
    }

    .order-details {
        width: 100%;
    }

    .order {
        width: 60%;
        float: left;
    }

    .order-img {
        height: 270px;
        float: right;
        width: 35%;
        margin-left: 5%;
    }

    .panel-header {
        color: #333333;
        background-color: #f5f5f5;
        border-color: #dddddd;
    }

    .button-large {
        padding: 10px 30px;
        font-size: 16px;
    }
</style>
<div class="xm-offline">
    <div class="row">
        <div class="panel">
            <div class="form-horizontal">
                <div class="panel-header">
                    <a href="${basepath}/manage/order/toList">返回上一级</a>
                </div>
                <div class="panel-body">

                    <h3>订单详情</h3>
                    <hr>
                    <div class="order-details">
                        <div class="order">
                            <div class="control-group">
                                <label class="control-label">
                                    订单号：
                                </label>

                                <p>${e.orderID!}</p>
                            </div>
                            <div class="control-group">
                                <label class="control-label">
                                    订单时间：
                                </label>

                                <p>${e.createTime!}</p>
                            </div>
                            <div class="control-group">
                                <label class="control-label">
                                    买家帐号：
                                </label>

                                <p>${e.account!}</p>
                            </div>
                            <div class="control-group">
                                <label class="control-label">
                                    商品名称：
                                </label>

                                <p>${e.productName!}</p>
                            </div>
                            <div class="control-group">
                                <label class="control-label">
                                    订单规格：
                                </label>

                                <p>${e.specInfo!}</p>
                            </div>
                            <div class="control-group">
                                <label class="control-label">
                                    订单数量：
                                </label>

                                <p>${e.number!}</p>
                            </div>
                            <div class="control-group">
                                <label class="control-label">
                                    商品单价：
                                </label>

                                <p>${e.price!}</p>
                            </div>
                            <div class="control-group">
                                <label class="control-label">
                                    订单金额：
                                </label>

                                <p>${e.total0!}</p>
                            </div>
                            <div class="control-group">
                                <label class="control-label">
                                    订单状态：
                                </label>

                                <p>${e.status!}</p>
                            </div>
                        </div>
                        <div class="order-img"><img src=""/></div>
                    </div>
                    <h3>物流信息</h3>
                    <hr>
                </div>
                <form id="detailForm" action="${basepath}/manage/order/sendProduct" class="form-horizontal"
                      method="post">
                    <input type="hidden" class="control-text span-width span8 hidden" name="addressID"
                           value="${e.addressID!}"/>
                    <input type="hidden" class="control-text span-width span8 hidden" name="id" value="${e.id!}"/>
                    <input type="hidden" class="control-text span-width span8 hidden" name="orderID"
                           value="${e.orderID!}"/>

                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            收货人：
                        </label>

                        <div class="controls">
                            <#if e.address??>
                                <input type="text" class="control-text span-width span8" value="${e.address.name!}"
                                       disabled/>
                            <#else>
                                <input type="text" class="control-text span-width span8" value=""
                                       disabled/>
                            </#if>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            收货地址：
                        </label>

                        <div class="controls">
                            <#if e.address??>
                                <input type="text" class="control-text span-width span8" value="${e.address.address!}"
                                       disabled>
                            <#else>
                                <input type="text" class="control-text span-width span8" value=""
                                       disabled>
                            </#if>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            联系电话：
                        </label>

                        <div class="controls">
                            <input type="text" class="control-text span-width span8" value="${e.address.phone!}"
                                   disabled>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            邮编：
                        </label>

                        <div class="controls">
                            <input type="text" class="control-text span-width span8" value="${e.address.zip!}" disabled>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            快递公司：
                        </label>

                        <div class="controls">
                            <input type="text" class="control-text span-width span8" name="expressCompany"
                                   value="${e.expressCompany!}" required>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            快递单号：
                        </label>

                        <div class="controls">
                            <input type="text" class="control-text span-width span8" name="expressNo"
                                   value="${e.expressNo!}" required>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            发货人：
                        </label>

                        <div class="controls">
                            <input type="text" class="control-text span-width span8" name="consignor"
                                   value="${e.consignor!}" required>
                        </div>
                    </div>
                    <div class="centered">
                        <button type="submit" class="button  button-large  button-success" id="sendProduct">发货</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script>
    if ("${e.status}" == "未付款") {
        $("#sendProduct").attr("disabled", "disabled");
    }
    var form = new BUI.Form.HForm({
        srcNode: '#detailForm'
    }).render();
    form.on('beforesubmit', function (ev) {
        if (!form.isValid()) {
        alert(1);
        }
    });
</script>
</@page.pageBase>